package com.example.j2025_11_10.Dao;

import com.example.j2025_11_10.Model.BookInfo;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class BookDao {
    public List<BookInfo> mockBook(){
        List<BookInfo> books = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            BookInfo book = new BookInfo();
            book.setId(i);
            book.setName("图书"+i);
            book.setAuthor("作者"+i);
            book.setCount(i);
            book.setPrice(new BigDecimal(new Random().nextInt(100)));
            book.setPublish("出版社"+i);
            book.setStatus(i%3==0? 1: 0);
            books.add(book);
        }
        return books;
    }
}
